home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / contrib / endfloat.sty < prev    next >
Encoding:
Text File  |  1995-03-15  |  9.1 KB  |  238 lines

  1. %% 
  2. %% This is file `endfloat.sty', generated 
  3. %% on <1995/3/4> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% endfloat.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE: 
  10. %% This is part of a set of tools (or better yet, experiments) 
  11. %% written by Jeff Goldberg (goldberg@nytud.hu), who doesn't 
  12. %% know LaTeX very well (yet). The usual disclaimers apply: 
  13. %% If it doesn't work right that's your problem. 
  14. %% And the usual conditions apply: If you change it, you take the blame; 
  15. %% if you pass it on, pass on all present condiditions; you 
  16. %% are not allowed to sell it. 
  17. \def\filename{endfloat}
  18. \def\fileversion{v2.2c}
  19. \def\filedate{1994/10/15}
  20. \def\docdate {1994/10/15}
  21. %% \CharacterTable
  22. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  23. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  24. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  25. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  26. %%   Dollar        \$     Percent       \%     Ampersand     \&
  27. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  28. %%   Asterisk      \*     Plus          \+     Comma         \,
  29. %%   Minus         \-     Point         \.     Solidus       \/
  30. %%   Colon         \:     Semicolon     \;     Less than     \<
  31. %%   Equals        \=     Greater than  \>     Question mark \?
  32. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  33. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  34. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  35. %%   Right brace   \}     Tilde         \~}
  36. %%
  37. %% Description: LaTeX style to put figures and tables at end of article
  38. %% Keywords: LaTeX, style-option, float, figure, table
  39. %% Author: James Darrell McCauley <jdm5548@diamond.tamu.edu>
  40. %% Maintainer: Jeff Goldberg <goldberg@nytud.hu>
  41. %% Latest Version: Version 2.2 <08 October 1994>
  42. \NeedsTeXFormat{LaTeX2e}[1994/06/01]
  43. \ProvidesPackage{endfloat}[\filedate\space\fileversion\space
  44.                LaTeX2e package puts figures and tables at end (jdm)]
  45. \newcommand{\EF@OldCmd}[2]{\PackageWarning{endfloat}
  46.   {The command \protect#1 is obsolete and will be\MessageBreak
  47.    omitted from future releases of the endfloat package.\MessageBreak
  48.    Use the package option `#2' instead.}}
  49. \newif\if@domarkers
  50. \newif\if@tablist                % bj
  51. \newif\if@figlist                % bj
  52. \newif\if@tabhead
  53. \newif\if@fighead
  54. \newif\if@tablesfirst
  55. \@domarkerstrue
  56. \@tablisttrue
  57. \@figlisttrue
  58. \@tabheadfalse
  59. \@figheadfalse
  60. \@tablesfirstfalse
  61. \DeclareOption{nomarkers}{\@domarkersfalse }
  62. \DeclareOption{markers}{\@domarkerstrue }
  63. \def\markersintext{\@domarkerstrue
  64.    \EF@OldCmd{\markersintext}{markers}}
  65. \def\nomarkersintext{\@domarkersfalse
  66.   \EF@OldCmd{\nomarkersintext}{nomarkers}}
  67. \def\dotablist{\@tablisttrue \EF@OldCmd{\dotablist}{tablist}}
  68. \def\notablist{\@tablistfalse \@tabheadtrue
  69.    \EF@OldCmd{\notablist}{notablist}}
  70. \def\dofiglist{\@figlisttrue \EF@OldCmd{\dogfiglist}{figlist}}
  71. \def\nofiglist{\@figlistfalse \@figheadtrue
  72.   \EF@OldCmd{\nofiglist}{nofiglist}}
  73. \DeclareOption{nolists}{\@tablistfalse \@figlistfalse }
  74. \DeclareOption{lists}{\@tablisttrue \@figlisttrue }
  75. \DeclareOption{notablist}{\@tablistfalse }
  76. \DeclareOption{nofiglist}{\@figlistfalse }
  77. \DeclareOption{tablist}{\@tablisttrue }
  78. \DeclareOption{figlist}{\@figlisttrue }
  79. \DeclareOption{heads}{\@figheadtrue \@tabheadtrue }
  80. \DeclareOption{noheads}{\@figheadfalse \@tabheadfalse }
  81. \DeclareOption{fighead}{\@figheadtrue }
  82. \DeclareOption{tabhead}{\@tabheadtrue }
  83. \DeclareOption{nofighead}{\@figheadfalse }
  84. \DeclareOption{notabhead}{\@tabheadfalse }
  85. \DeclareOption{tablesfirst}{\@tablesfirsttrue }
  86. \DeclareOption{figuresfirst}{\@tablesfirstfalse }
  87. \DeclareOption*{%
  88.    \PackageWarning{endfloat}{Unknown option `\CurrentOption'}}
  89. \ProcessOptions
  90. \newcounter{postfig}
  91. \newwrite\@postfigs
  92. \newif\if@postfigsopen \global\@postfigsopenfalse
  93.  \def\@openpostfigs{\immediate\openout\@postfigs=\jobname.fff\relax
  94.       \message{(\jobname.fff)}%
  95.       \global\@postfigsopentrue}
  96. \newcounter{posttbl}
  97. \newwrite\@posttbls
  98. \newif\if@posttblsopen \global\@posttblsopenfalse
  99. \def\@openposttbls{\immediate\openout\@posttbls=\jobname.ttt\relax
  100.       \message{(\jobname.ttt)}%                                      % bj
  101.       \global\@posttblsopentrue}
  102. \def\makeinnocent#1{\catcode`#1=12 }
  103. \providecommand{\figurename}{Figure}
  104. \providecommand{\tablename}{Table}
  105. \newcommand{\figureplace}{%
  106.    \begin{center}
  107.      [\figurename~\thepostfig\ about here.]
  108.    \end{center}}
  109. \newcommand{\tableplace}{%
  110.    \begin{center}
  111.       [\tablename~\theposttbl\ about here.]
  112.    \end{center}}
  113. \def\@gobbleuntilnext[#1]{}  % Not used (jpg)
  114. \let\@bfig\figure             % bj
  115. \let\@efig\endfigure          % bj
  116. \let\@btab\table              % bj
  117. \let\@etab\endtable           % bj
  118. \let\endfigure\relax          % bj
  119. \let\endtable\relax           % bj
  120. \def\figure{%
  121.     \if@postfigsopen \else \@openpostfigs \fi%
  122.     \immediate\write\@postfigs{\string
  123.          \begin{figure}}%
  124.     \if@domarkers%
  125.        \addtocounter{postfig}{1}% % bj
  126.        \figureplace%              % bj
  127.     \fi%
  128.     \begingroup%
  129.     \let\do\makeinnocent \dospecials%
  130.     \makeinnocent\^^L% and whatever other special cases
  131.     \endlinechar`\^^M \catcode`\^^M=12 \xfigure}%
  132. \def\efloat@foundendfig{\def\next{\endgroup\end{figure}%
  133.           \immediate\write\@postfigs{\string\end{figure}}%
  134.           \immediate\write\@postfigs{\string\clearpage}%
  135.           \immediate\write\@postfigs{ }}}%
  136. \def\efloat@foundendtab{\def\next{\endgroup\end{table}
  137.           \immediate\write\@posttbls{\string\end{table}}
  138.           \immediate\write\@posttbls{\string\clearpage}
  139.           \immediate\write\@posttbls{ }}}
  140. {\catcode`\^^M=12 \endlinechar=-1 %
  141.  \gdef\xfigure#1^^M{\def\test{#1}%
  142.       \ifx\test\endfiguretest
  143.            \efloat@foundendfig
  144.       \else\ifx\test\enddblfiguretest
  145.            \efloat@foundendfig
  146.       \else%
  147.           \immediate\write\@postfigs{#1}%
  148.           \let\next\xfigure%
  149.       \fi \fi \next}%
  150. }%
  151. {\escapechar=-1%
  152.  \xdef\endfiguretest{\string\\end\string\{figure\string\}}%
  153.  \xdef\enddblfiguretest{\string\\end\string\{figure*\string\}}%
  154. }%
  155. \def\table{\if@posttblsopen \else \@openposttbls \fi
  156.     \immediate\write\@posttbls{\string\begin{table}}%
  157.     \if@domarkers
  158.        \addtocounter{posttbl}{1} % bj
  159.        \tableplace               % bj
  160.     \fi
  161.     \def\@currenvir{table}%
  162.     \begingroup
  163.     \let\do\makeinnocent \dospecials
  164.     \makeinnocent\^^L% and whatever other special cases
  165.     \endlinechar`\^^M \catcode`\^^M=12 \xtable}
  166. {\catcode`\^^M=12 \endlinechar=-1 %
  167.  \gdef\xtable#1^^M{\def\test{#1}
  168.       \ifx\test\enddbltabletest
  169.           \efloat@foundendtab
  170.       \else\ifx\test\endtabletest
  171.           \efloat@foundendtab
  172.       \else
  173.           \immediate\write\@posttbls{#1}%
  174.           \let\next\xtable
  175.       \fi \fi \next}
  176. }
  177. {\escapechar=-1
  178.  \xdef\enddbltabletest{\string\\end\string\{table*\string\}}
  179.  \xdef\endtabletest{\string\\end\string\{table\string\}}
  180. }
  181. \@namedef{figure*}{\figure}
  182. \@namedef{table*}{\table}
  183. \def\endfloat{\endfigure}
  184. \providecommand{\figuresection}{Figures}
  185. \providecommand{\tablesection}{Tables}
  186. \def\processfigures{
  187.   \if@postfigsopen
  188.   \immediate\closeout\@postfigs \global\@postfigsopenfalse
  189.   \let\figure\@bfig              % bj
  190.   \let\endfigure\@efig           % bj
  191.   \clearpage                                                        % bj
  192.   \if@figlist                                                       % bj
  193.     {\normalsize\listoffigures}                                     % bj
  194.     \clearpage                                                      % bj
  195.   \fi
  196.   \if@fighead
  197.      \section*{\figuresection}                                   % bj
  198.      \suppressfloats[t]                                          % jpg
  199.   \fi
  200.   \markboth{\uppercase{\figuresection}}{\uppercase{\figuresection}}% bj
  201.   {\def\baselinestretch{1}\normalsize                                % bj
  202.   \@input{\jobname.fff}}                                             % bj
  203.  \fi}
  204. \def\processtables{
  205. \if@posttblsopen
  206.   \immediate\closeout\@posttbls \global\@posttblsopenfalse
  207.   \let\table\@btab               % bj
  208.   \let\endtable\@etab            % bj
  209.   \clearpage                                                      % bj
  210.   \if@tablist                                                     % bj
  211.     {\normalsize\listoftables}                                    % bj
  212.     \clearpage                                                    % bj
  213.   \fi
  214.   \if@tabhead
  215.       \section*{\tablesection}                                  % bj
  216.       \suppressfloats[t]                                        % jpg
  217.   \fi
  218.   \markboth{\uppercase{\tablesection}}{\uppercase{\tablesection}}% bj
  219.   {\def\baselinestretch{1}\normalsize                              % bj
  220.   \@input{\jobname.ttt}}                                           % bj
  221.  \fi}
  222. \def\efloat@setfparams{%
  223.     \renewcommand{\bottomfraction}{1.0}%
  224.     \renewcommand{\topfraction}{1.0}%
  225.     \renewcommand{\textfraction}{0.0}}
  226. \AtEndDocument{%                                      % jpg
  227.    \message{AED endfloat: Processing end Figures and Tables}% % jpg
  228.    \onecolumn
  229.    \efloat@setfparams
  230.    \if@tablesfirst
  231.       \processtables\clearpage\processfigures
  232.    \else
  233.       \processfigures\clearpage\processtables
  234.    \fi} % jpg
  235. \endinput
  236. %% 
  237. %% End of file `endfloat.sty'.
  238.